import redis
from common.config import Config

config = Config()
host = config.get_redis("host")
port = config.get_redis("port")


class Rd:
    def __init__(self):
        self.r = redis.Redis(connection_pool=redis.ConnectionPool(host=host, port=port, decode_responses=True))

    def set(self, key, value):
        self.r.set(key, value)

    def get(self, key):
        return self.r.get(key)


if __name__ == "__main__":
    a = Rd()
    a.set("test", "12")
    print(a.get("test"))

